[mirrors]
https://curl.haxx.se/download/curl-7.48.0.tar.lzma

[vars]
filesize=5924818
sha512=1e4cc613aa56d3547beff46c3124a6cb3ba5df89da00055df0b27e2ad57beccec33fd80b2b0d0858cf0de45da5ab5cad8345b0f23f0c536a690a5eab7518a3af

[deps]
libressl
ca-certificates
zlib

[build]
patch -p1 < "$K"/curl-libressl.patch

[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine) --with-sysroot=$butch_root_dir"

CPPFLAGS="-D_GNU_SOURCE" \
CFLAGS="$optcflags" \
LDFLAGS="$optldflags" \
LIBS="-lssl -lcrypto -lz" \
./configure -C \
  --prefix="$butch_prefix" \
  --with-ssl \
  --enable-ipv6 \
  --with-ca-path="$butch_prefix"/etc/ssl/certs \
  --with-random=/dev/urandom $xconfflags

sed -i -e '/SUBDIRS/s:scripts::' Makefile
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install
